package com.sinosoft.dsp.platform.components.portal.input.elements;

import org.hibernate.Query;

import com.sinosoft.builder.templates.concept.TagElementType;
import com.sinosoft.dsp.system.utils.Const;

public class SinoAbstractStringTagElement {
	private String value;

	public void initValue(TagElementType type) {
		if (type != null) {
			this.value = type.getValue();
		}
	}

	public void setParameter(Query query, String key) {
		if (!isEmpty()) {
			query.setParameter(key, value);
		}
	}

	public boolean isEmpty() {
		return Const.isEmpty(value);
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}
}
